<include file="Public/min-header"/>
<section class="wrapper">
    <!-- Main content -->
    <div class="row">
        <div class="col-xs-12">
            <div class="panel">
                <div class="panel-heading">
                    <i class="icon-envelope"></i>站内信
                </div>
                <div class="panel-body">
                    <div class="navbar navbar-default">
                            <form action="" id="search-form2" class="navbar-form form-inline" method="post" onsubmit="return false">
                                <div class="form-group">
					                  <select name="status" id="is_on_sale" class="form-control selectDemo">
					                    <option value="">全部</option>                  
					                    <option value="0" selected="selected">未读</option>
					                    <option value="1">已读</option>
					                  </select>
                                      <span class="caret"></span>
				                </div>        
				                 <div class="form-group">
    				                  <select name="type" id="is_on_sale" class="form-control selectDemo">
    				                    <option value="">全部</option>                  
    				                    <option value="0">个体消息</option>
    				                    <option value="1">系统消息</option>
    				                    <option value="2">我发送的</option>
    				                  </select>
                                      <span class="caret"></span>
				                </div>  
                                <div class="form-group">
                                	  <button type="submit" onclick="ajax_get_table('search-form2',1)" id="button-filter search-order" class="btn btn-primary pull-right">筛选</button>
                                </div>
                            </form>
                    </div>
                    <div id="ajax_return">

                    </div>
                </div>
            </div>
        </div>        <!-- /.row -->
    </div>
    
    
		    <!-- Modal 发送站内信 -->
		<div class="modal fade" id="sendMessageBox" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		    <div class="modal-dialog bigmodal">
		        <div class="modal-content">
		            <div class="modal-header">
		                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		                <h4 class="modal-title">发送站内信</h4>
		            </div>
		            <div class="modal-body">
		                <div class="form-group">
		                  <label class="col-sm-1-8 control-label">标题</label>
		                  <div class="col-sm-7-8">
		                    <input type="text" class="form-control" name="title" id="title">
		                  </div>
		                </div>
		                <div class="form-group-nohidden">
		                  <label class="col-sm-1-8 control-label">收信人</label>
		                  <div class="col-sm-7-8">
		                    <select id="user" name="user" class="selectpicker" data-live-search="true">
		                      	<option>请选择</option>
		                      	<foreach name="users" item="vv" key="kk">
		                        	<option value ="{$vv.admin_id}">{$vv.name}</option>
		                      	</foreach>                   
		                    </select>
		                  </div>
		                </div>
		                <div class="form-group">
		                  <label class="col-sm-1-8 control-label">内容</label>
		                  <div class="col-sm-7-8">
		                      <textarea name="text" id="text" class="form-control error" name="comment" rows="6" required=""></textarea>
		                  </div>
		                </div>
		            </div>
		            <div class="modal-footer">
		                <button class="btn btn-submit" type="submit" onclick="sendMessageForm()">发送</button>
		            </div>
		        </div>
		    </div>
		</div>                                           
<!-- modal -->
    <!-- /.content -->
</section>
<!-- /.content-wrapper -->

	<!--new script for this page only-->
    <script src="__PUBLIC__/js/bootstrap-select.js"></script>

<script>
    $(document).ready(function(){
        ajax_get_table('search-form2',1);

    });

    // ajax 抓取页面
    function ajax_get_table(tab,page){
        cur_page = page; //当前页面 保存为全局变量
            $.ajax({
                type : "POST",
                url:"/index.php/Msg/ajaxmsg/p/"+page,//+tab,
                data : $('#'+tab).serialize(),// 你的formid
                success: function(data){
                    $("#ajax_return").html('');
                    $("#ajax_return").append(data);
                }
            });
    }

</script>
</body>
</html>